<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title><s:text name="system.page.title"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.8.0.js" charset="utf-8"></script>
<script type="text/javascript" src="js/ready.js" charset="utf-8"></script>
<script type="text/javascript" src="js/win.js" charset="utf-8"></script>
<script type="text/javascript" src="js/base.js" charset="utf-8"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function trClick(id) {
		$("#survey_id").val(id);
	}
	function saveSurvey_org() {
		$("#survey_id").val("");
		survey_orgForm();
	}
	function survey_orgForm() {
		$.openWin({iframe:true,id:"orgWin",width:600,height:500,action:"treeSurveySelect.do",title:"添加机构"});
	}
	function survey_orgSearch(p) {
		$("#currentPage").val(p);
		formId.action = "searchSurvey_org.do";
		formId.submit();
	}
	function deleteSurvey_org() {
		var id = $("#survey_id").val();
		if(id != "") {
			if(confirm("<s:text name='system.rec.del'/>")) {				
				formId.action = "deleteSurvey_org.do";
				formId.submit();
			}
		} else {
			alert("<s:text name='system.rec.select'/>");
		}
	}
	function settingOrg(orgId) {
		if(orgId == "") {
			alert("<s:text name='system.rec.select.org'/>");
		} else {
			$.closeWin("orgWin");
			$("#org_ids").val(orgId);
			formId.action="editorSurvey_org.do";
			formId.submit();
		}
	}
</script>
</head>
<body>
<div class="tools">
	<div class="tool">
	<ul>
		<li>
			<div onclick="saveSurvey_org();"><img src="image/button/NEW20.gif"/><span><s:text name='system.button.new'/></span></div>
		</li>
		<li>
			<div onclick="deleteSurvey_org();"><img src="image/button/DEL20.gif"/><span><s:text name='system.button.del'/></span></div>
		</li>
	</ul>
	</div>
</div>
<form action="" method="post" id="formId" name="formId">
<input type="hidden" name="bean.survey_id" id="survey_id">
<s:hidden name="bean.project_id"/>
<s:hidden name="bean.org_ids" id="org_ids"/>
<s:hidden name="pageBean.currentPage" id="currentPage"/>
<div class="tabledata">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="listtable">
		<tr class="trhead">
			<td><s:text name='system.rec.seq'/></td>
			<td><s:text name='rec.cusorg.org_num'/></td>
			<td><s:text name='rec.cusorg.org_name'/></td>
			<td><s:text name='rec.cusorg.telphone'/></td>
			<td><s:text name='rec.cusorg.linkman'/></td>
			<td><s:text name='rec.cusorg.phone'/></td>
			<td><s:text name='rec.cusorg.email'/></td>
			<td><s:text name='rec.cusorg.address'/></td>
		</tr>
		<s:set name="seq" value="pageBean.startRow + 1" />
		<s:set name="start" value="#seq"/>
		<s:iterator value="list" id="l">
		<tr <s:if test="#seq%2==0">class="trodd"</s:if><s:else>class="treven"</s:else> trclikc="trClick(<s:property value="#l.survey_id"/>)" >
			<td><s:property value="#seq"/></td>
			<td><s:property value="#l.org_num"/></td>
			<td><s:property value="#l.org_name"/></td>
			<td><s:property value="#l.telphone"/></td>
			<td><s:property value="#l.linkman"/></td>
			<td><s:property value="#l.phone"/></td>
			<td><s:property value="#l.email"/></td>
			<td><s:property value="#l.address"/></td>
		</tr>
		<s:set name="seq" value="#seq + 1"/>
		</s:iterator>
		<s:set name="end" value="#seq-1"/>
	</table>
</div>
<div class="page">
	<div class="pagelist" style="width:100%;">
		<s:if test="list.size!=0">
		<span>
			<img src="image/button/start_off.gif" width="11" height="9" border="0" align="middle" onclick="survey_orgSearch(<s:property value="pageBean.first"/>)">
			<span><s:text name='system.page.first'/></span>
			<img src="image/button/previous_off.gif" width="6" height="9" border="0" align="middle" onclick="survey_orgSearch(<s:property value="pageBean.pre"/>)">
			<span><s:text name='system.page.pre'/></span>
			<span><s:property value="#start"/>-<s:property value="#end"/>/<s:property value="pageBean.totalRec"/><s:text name='system.page.rec'/> <s:property value="pageBean.currentPage"/>/<s:property value="pageBean.totalPage"/><s:text name='system.page.p'/></span>
			<span><s:text name='system.page.next'/></span>
			<img src="image/button/next_off.gif" width="6" height="9" border="0" align="middle" onclick="survey_orgSearch(<s:property value="pageBean.next"/>)">
			<span><s:text name='system.page.last'/></span>
			<img src="image/button/end_off.gif" width="11" height="9" border="0" align="middle" onclick="survey_orgSearch(<s:property value="pageBean.last"/>)">
		</span>
		</s:if>
	</div>
</div>
</form>
</body>
</html>